import request from '@/utils/request'

//获取列表的接口
export const reqTradeMark = (page, limit) => {
  return request.get(`/admin/product/baseTrademark` + `/${page}/${limit}`)
};

//添加品牌的接口 无需ID
//修改品牌的接口 需要ID
export const reqAddorUpdateTradeMark = (tradeMark) => {
  if (tradeMark.id) {
    return request({
      url: '/admin/product/baseTrademark/update',
      method: 'put',
      data: tradeMark
    })
  } else {
    return request({
      url: '/admin/product/baseTrademark/save',
      method: 'post',
      data: tradeMark
    })
  }
}

//删除品牌的接口
export const reqDeleteTradeMark = (id) => request({
  url: `/admin/product/baseTrademark/remove/${id}`,
  method: 'delete'
})